<?php
include "../config/connection.inc";
function getDegrees(){
    $query = "select * from DEGREES";
    return mysql_query($query);
}

function getDegreesById($id){
    $query = "select * from DEGREES where DEGREE_ID = $id";
    return mysql_fetch_array(mysql_query($query));
}

function insertDegrees($degree){
    $query = "INSERT INTO DEGREES".
              " VALUES (NULL, '".$degree['title']."','".$degree['descript']."')";
    $result = mysql_query($query);
    return $result;
}

function deleteDegree($id){
    $query = "delete from DEGREES where DEGREE_ID = $id";
    $result = mysql_query($query);
    return $result;
}

function editDegree($degree){
    $query = "update DEGREES set 
            DEGREE_TITLE = '".$degree['title']."',
            DEGREE_DESCRIPTION = '".$degree['descript']."'
             where DEGREE_ID = '".$degree['id']."'";
    $result = mysql_query($query);
    return $result;
}
?>